home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c
- Path: surfnet.nl!sun4nl!nikhefk!bouvere
- From: bouvere@paramount.nikhefk.nikhef.nl (Ferdinand de Bouvere)
- Subject: What is the correct behaviour ?
- Message-ID: <1996Mar9.130223.1400@paramount.nikhefk.nikhef.nl>
- Organization: NIKHEFK
- Date: Sat, 9 Mar 1996 13:02:23 GMT
-
- Trying this code on 3 platforms:
-
- int a = 0;
-
- main()
- {
- int a = 123;
- {
- extern int a;
- printf("%d\n", a);
- }
- }
-
- HP/UX compiler: OK
- result: 0
-
- Linux gcc: OK
- result: 123
-
- SUN compiler (pre ansi): compile error:
- "c.c", line 7: redeclaration of a
- Compilation failed
-
- So, what should be the correct behaviour ?
-
- Ferdi,
- <bouvere@nikhefk.nikhef.nl>
-
-